package com.struts.action.impl;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;

import com.struts.action.IAction;
import com.struts.pojo.BaseFormVo;
import com.struts.pojo.MessageVo;
import com.struts.pojo.PanduanFormVo;
import com.struts.service.IPanduanService;
import com.struts.service.impl.PanduanServiceImpl;



public class PanduanAction implements IAction{


	@Override
	public String exeute(HttpServletRequest request, BaseFormVo form,
			Map<String, String> formForward) {
		String url = "";
		PanduanFormVo panduanForm = (PanduanFormVo)form;
		IPanduanService  service = new PanduanServiceImpl();
		Map<String, MessageVo> map = service.getVO(panduanForm.getName());
		Set<String> set = map.keySet();
		for(Iterator<String> it = set.iterator(); it.hasNext();) {
			url = it.next();
			request.setAttribute("mess", map.get(url));
		}
		return formForward.get(url);
	}}
